package com.hle.union;

public class UnionFind_QU_R_PS extends UnionFind_QU_R {

	public UnionFind_QU_R_PS(int capacity) {
		super(capacity);
	}
	
	@Override
	public int find(int v) {
		while (parents[v] != v) {
			int parent = parents[v];
			parents[v] = parents[parent];
			v = parent;
		}
		return v;
	}
}
